<?php

error_reporting(E_ALL ^ E_NOTICE);
 //FUNCTION: Connect to PostgreSql database

set_time_limit(0);
ini_set("memory_limit", "200M");
  pg_connect("host=localhost dbname=comds  user=root  password=root")
   or die('Could not connect:'.pg_last_error());

  $update_query = pg_query("select id,whatday from comds");

while($update = pg_fetch_array($update_query))
{
	  $whatday = substr($update[whatday],0,10);

	 pg_query("UPDATE comds SET whatday = '$whatday' WHERE id = '$update[id]'");
}
  var_dump($whatday);die;


//pg_close($con);
?>